<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>添加产品分类</title>
    <link href="__STATIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="__STATIC__/admin/css/style.css" />
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/ace.min.css" />
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/font-awesome.min.css" />
    <link href="__STATIC__/admin/Widget/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <!--[if IE 7]>
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/font-awesome-ie7.min.css" />
    <![endif]-->
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/ace-ie.min.css" />
    <![endif]-->
    <script src="__STATIC__/admin/js/jquery-1.9.1.min.js"></script>
    <script src="__STATIC__/admin/assets/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="__STATIC__/admin/bootstrap-fileinput-master/css/fileinput.css"/>
    <script src="__STATIC__/admin/bootstrap-fileinput-master/js/fileinput.js"></script>
    <script src="__STATIC__/admin/bootstrap-fileinput-master/js/locales/zh.js"></script>

</head>

<body>
<div class="type_style">
    <div class="crumbs">
        <ul>
            <li>
                <a href="index.html">文章管理</a>
            </li>
            <li class="uline">/</li>
        </ul>
    </div>
    <form action="{:url('question/edite')}" method="post" class="form form-horizontal">
        <input type="hidden" name="q_id" value="{$data.q_id}">
        <div class="Operate_cont clearfix">
            <label class="form-label">文章标题:</label>
            <div class="formControls ">
                <input type="text" class="input-text" value="{$data.q_title}" placeholder=""  name="q_title" datatype="*" nullmsg="文章标题不能为空！">
                <span class="Validform_checktip"></span>
            </div>
        </div>
        <div class="Operate_cont clearfix">
            <label class="form-label">文章内容:</label>
            <div class="formControls ">
                <textarea id="content" name="q_desc">{$data.q_desc}</textarea>
                <span class="Validform_checktip"></span>
            </div>
        </div>
        <div role="tabpanel" class="tab-pane" id="img">
            <input id="imgUpload" type="file" class="file-loading">
            <input type="hidden" name="image" id="image" value="">
            <input type="hidden" name="image_thumb" id="image_thumb" value="">
        </div>
        <div class="Operate_cont clearfix">
            <input class="btn btn-primary radius Operate_cont_btn" type="submit" value="提交">
        </div>
    </form>
</div>

<script type="text/javascript" src="__STATIC__/admin/Widget/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript">
    $(function() {
        //表单验证
        $("form").Validform({
            tiptype:function(msg,o,cssctl){
                if(!o.obj.is("form")){
                    //默认表单
                    var objtip=o.obj.parents(".formControls").find(".Validform_checktip");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }
            },
            showAllError:true
        })
    });
    $('#imgUpload').fileinput({
        language:'zh',
        uploadUrl:'{:url("question/uploadImg")}',
        autoRelace:true,
        maxFileCount:1,
        allowedFileExtensions:["jpg","png","gif"],
        browseClass:"btn btn-primary",
        previeFileIcon:"<i class='glyphicon glyphicon-king'></i>"
    });
    $('#imgUpload').on('fileuploaded',function (e,data) {
        if(data.response.status>0){
            $('#image').val(data.response.path);
            $('#image_thumb').val(data.response.thumb);
        }else{
            alert(data.response.err);
        }
    });
    $(document).ready(function () {
        $('#content').summernote();
    });
</script>
</body>
</html>